The present disclosure relates to a computer implemented method and system for optimizing data collection. Existing software systems which implement data collection and more specifically diagnostic data collection for problem resolution can be cumbersome, for example, due to the complexity of the data collection process. Typical data collection can also be resource intensive. The data collection process can involve dumping data and analyzing the data to isolate a particular problem/ticket. This approach can require highly skilled administrators along with end user involvement, e.g., requiring specific user to log in and out of a system, to assist with the data collection. Further, with regard to production systems, such data collection can negatively impact the performance of the system. This can negatively affect all users and/or organizations using the production system. Such delays can lead to postponement of collection, which in turn, can delay problem resolution and interfere with service level agreements (SLAs). Further, data collection for problem resolution can include a significant time commitment from resources. A significant amount of data can be collected and can be difficult to transfer and analyze in a timely fashion because of the large amount of data. For example, the data collection and the data analysis can require a significant amount of computing time and resources because of the large amount of data.